<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/templates/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.CreateProductTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.CreateProductLabel_id}" for="id" />
                    <h:inputText id="id" value="#{productController.selected.id}" title="#{bundle.CreateProductTitle_id}" required="true" requiredMessage="#{bundle.CreateProductRequiredMessage_id}"/>
                    <h:outputLabel value="#{bundle.CreateProductLabel_name}" for="name" />
                    <h:inputText id="name" value="#{productController.selected.name}" title="#{bundle.CreateProductTitle_name}" required="true" requiredMessage="#{bundle.CreateProductRequiredMessage_name}"/>
                    <h:outputLabel value="#{bundle.CreateProductLabel_unit}" for="unit" />
                    <h:inputText id="unit" value="#{productController.selected.unit}" title="#{bundle.CreateProductTitle_unit}" />
                    <h:outputLabel value="#{bundle.CreateProductLabel_vatRate}" for="vatRate" />
                    <h:inputText id="vatRate" value="#{productController.selected.vatRate}" title="#{bundle.CreateProductTitle_vatRate}" required="true" requiredMessage="#{bundle.CreateProductRequiredMessage_vatRate}"/>
                    <h:outputLabel value="#{bundle.CreateProductLabel_unitNetPrice}" for="unitNetPrice" />
                    <h:inputText id="unitNetPrice" value="#{productController.selected.unitNetPrice}" title="#{bundle.CreateProductTitle_unitNetPrice}" required="true" requiredMessage="#{bundle.CreateProductRequiredMessage_unitNetPrice}"/>
                    <h:outputLabel value="#{bundle.CreateProductLabel_pkwiu}" for="pkwiu" />
                    <h:inputText id="pkwiu" value="#{productController.selected.pkwiu}" title="#{bundle.CreateProductTitle_pkwiu}" />
                    <h:outputLabel value="#{bundle.CreateProductLabel_quantity}" for="quantity" />
                    <h:inputText id="quantity" value="#{productController.selected.quantity}" title="#{bundle.CreateProductTitle_quantity}" required="true" requiredMessage="#{bundle.CreateProductRequiredMessage_quantity}"/>
                    <h:outputLabel value="#{bundle.CreateProductLabel_invoice}" for="invoice" />
                    <h:selectOneMenu id="invoice" value="#{productController.selected.invoice}" title="#{bundle.CreateProductTitle_invoice}" required="true" requiredMessage="#{bundle.CreateProductRequiredMessage_invoice}">
                        <f:selectItems value="#{invoiceController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                </h:panelGrid>
                <br />
                <h:commandLink action="#{productController.create}" value="#{bundle.CreateProductSaveLink}" />
                <br />
                <br />
                <h:commandLink action="#{productController.prepareList}" value="#{bundle.CreateProductShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:link outcome="/index" value="#{bundle.CreateProductIndexLink}"/>
            </h:form>
        </ui:define>
    </ui:composition>

</html>
